package com.yaorange.teaching.service.impl;

import java.util.List;
import com.yaorange.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yaorange.teaching.mapper.YaTeacherMapper;
import com.yaorange.teaching.domain.YaTeacher;
import com.yaorange.teaching.service.IYaTeacherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 教师信息Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class YaTeacherServiceImpl extends ServiceImpl<YaTeacherMapper,YaTeacher> implements IYaTeacherService
{
    @Autowired
    private YaTeacherMapper yaTeacherMapper;

    /**
     * 查询教师信息
     *
     * @param id 教师信息主键
     * @return 教师信息
     */
    @Override
    public YaTeacher selectYaTeacherById(Long id)
    {
        return yaTeacherMapper.selectYaTeacherById(id);
    }

    /**
     * 查询教师信息列表
     *
     * @param yaTeacher 教师信息
     * @return 教师信息
     */
    @Override
    public List<YaTeacher> selectYaTeacherList(YaTeacher yaTeacher)
    {
        return yaTeacherMapper.selectYaTeacherList(yaTeacher);
    }

    /**
     * 新增教师信息
     *
     * @param yaTeacher 教师信息
     * @return 结果
     */
    @Override
    public int insertYaTeacher(YaTeacher yaTeacher)
    {
        yaTeacher.setCreateTime(DateUtils.getNowDate());
        return yaTeacherMapper.insertYaTeacher(yaTeacher);
    }

    /**
     * 修改教师信息
     *
     * @param yaTeacher 教师信息
     * @return 结果
     */
    @Override
    public int updateYaTeacher(YaTeacher yaTeacher)
    {
        yaTeacher.setUpdateTime(DateUtils.getNowDate());
        return yaTeacherMapper.updateYaTeacher(yaTeacher);
    }

    /**
     * 批量删除教师信息
     *
     * @param ids 需要删除的教师信息主键
     * @return 结果
     */
    @Override
    public int deleteYaTeacherByIds(Long[] ids)
    {
        return yaTeacherMapper.deleteYaTeacherByIds(ids);
    }

    /**
     * 删除教师信息信息
     *
     * @param id 教师信息主键
     * @return 结果
     */
    @Override
    public int deleteYaTeacherById(Long id)
    {
        return yaTeacherMapper.deleteYaTeacherById(id);
    }
}
